# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>
# Contributor: FigoDaPaura <ffigoDaPaura>
# Contributor: Andres Jimenez

pkgname=virtualgl
pkgver=2.3.2
pkgrel=3
pkgdesc="Redirects 3D commands from an OpenGL application onto a server-side 3D graphics card"
arch=('i686' 'x86_64')
url="http://virtualgl.org"
license=('LGPL')
depends=('libxv' 'glu' 'turbojpeg')
makedepends=('cmake' 'mesa')
source=("http://downloads.sourceforge.net/project/virtualgl/VirtualGL/$pkgver/VirtualGL-$pkgver.tar.gz")
sha1sums=('f042862c21ceaba57c6e1f0ec72adb4f838725e9')
 
build() {
  cd "$srcdir/VirtualGL-$pkgver"
 
  mkdir -p build && cd build
 
  cmake .. \
      -DCMAKE_INSTALL_PREFIX=/usr/share \
      -DTJPEG_INCLUDE_DIR=/usr/include \
      -DTJPEG_LIBRARY=/usr/lib/libturbojpeg.so \
      -DVGL_LIBDIR=/usr/lib \
      -DVGL_BINDIR=/usr/bin \
      -DVGL_DOCDIR=/usr/share/doc/${pkgname}
  make
}
 
package() {
  cd "$srcdir/VirtualGL-$pkgver/build"
  make install DESTDIR="$pkgdir"
 
  mv "$pkgdir"/usr/bin/glxinfo "$pkgdir"/usr/bin/vglxinfo
}
